//
//  ZTAirRecordButton.m
//  YSSmartHome
//
//  Created by yanghao on 2017/4/7.
//  Copyright © 2017年 yahaong. All rights reserved.
//

#import "ZTAirRecordButton.h"

@implementation ZTAirRecordButton

- (instancetype)initWithTitle:(NSString*)title imageName:(NSString*)imageName
{
    self = [super init];
    if (self) {
        [self setBackgroundColor:[UIColor whiteColor]];
        [self setTitle:title forState:UIControlStateNormal];
        [self setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        CGRect rect =  [self.titleLabel.text boundingRectWithSize:CGSizeMake(MAXFLOAT, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: self.titleLabel.font} context:nil];
        self.titleEdgeInsets = UIEdgeInsetsMake(0, -19, 0, 19);
        self.imageEdgeInsets = UIEdgeInsetsMake(0,rect.size.width, 0,-rect.size.width);
    }
    return self;
}

@end
